import { DataSource } from 'typeorm';
import { User } from './entity/User';
import { Profile } from './entity/Profile';
import { Order } from './entity/Order'

export const AppDataSource = new DataSource({
  type: 'mysql',     //数据库类型是mysql
  host: '127.0.0.1',
  port: 3306,
  username: 'root',
  password: 'mysql_password',
  database: 'orm',
  synchronize: true,  //是否自动同步实体于数据的结构，开发时为true，上线后为false
  logging: true,      // 是否启用日志
  // entities: [User, Profile, Order],      //实体类数据，指的是要用到的实体
  entities: ["**/entity/*.ts"],      //通配符，导入该文件夹下所有的实体
});
